<%--
  Created by IntelliJ IDEA.
  User: QiangweiLuo
  Date: 12/21/2018
  Time: 7:15 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div id="header" class="wrap">
    <img src="${pageContext.request.contextPath}/images/logo.gif" />
</div>
<div id="navbar" class="wrap">
    <div class="profile">
        <c:if test="${empty user or user == null }">
            <a href="${pageContext.request.contextPath}/login?method=forward">登录</a>&nbsp;&nbsp;
            <a href="${pageContext.request.contextPath}/register?method=forward">注册</a>
        </c:if>
        <c:if test="${not empty user or user != null }">
            您好，${user.name }&nbsp;&nbsp;
            <a href="${pageContext.request.contextPath}/login?method=logout">退出</a>
        </c:if>
        <span class="return"><a href="${pageContext.request.contextPath}/list?method=forward">返回列表</a></span>
        <span class="addnew"><a href="${pageContext.request.contextPath}/list/add?method=forward">添加新投票</a></span>
        <span class="modify"><a href="${pageContext.request.contextPath}/list/modify?method=forward">维护</a></span>
    </div>
    <div class="search">
        <form method="post" action="${pageContext.request.contextPath}/list?method=find">
            <input type="text" name="keywords" class="input-text" value="${keywords}"/><input type="submit" name="submit" class="input-button" value="" />
        </form>
    </div>
</div>